﻿using Simple.Contracts.Enums.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Contracts.Contracts
{
    /// <summary>
    /// Redis缓存服务
    /// </summary>
    public interface IRedisService
    {
        /// <summary>
        /// 获取登录TokenKey
        /// </summary>
        /// <param name="companyId"></param>
        /// <param name="employeeId"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        string GetAccountLoginTokenKey(long companyId, long employeeId, string token);
        /// <summary>
        /// 设置登录Token
        /// </summary>
        /// <param name="token"></param>
        /// <param name="value"></param>
        /// <param name="companyId"></param>
        /// <param name="employeeId"></param>
        /// <param name="timeoutSeconds"></param>
        void SetAccountLoginToken(string token, string value, long companyId, long employeeId, int timeoutSeconds);
        /// <summary>
        /// 获取登录Token
        /// </summary>
        /// <param name="companyId"></param>
        /// <param name="employeeId"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        string GetAccountLoginToken(long companyId, long employeeId, string token);


        /// <summary>
        /// 获取微信小程序全局唯一后台接口调用凭据-KEY
        /// </summary>
        /// <param name="weChatAppClient"></param>
        /// <returns></returns>
        string GetWechatAccessTokenKey(WeChatAppClientEnum weChatAppClient);
        /// <summary>
        /// 设置微信小程序全局唯一后台接口调用凭据
        /// </summary>
        /// <param name="weChatAppClient"></param>
        /// <param name="accesstoken"></param>
        /// <param name="timeoutSeconds"></param>
        void SetWechatAccessToken(WeChatAppClientEnum weChatAppClient, string accesstoken, int timeoutSeconds);
        /// <summary>
        /// 获取微信小程序全局唯一后台接口调用凭据
        /// </summary>
        /// <param name="weChatAppClient"></param>
        /// <returns></returns>
        string GetWechatAccessToken(WeChatAppClientEnum weChatAppClient);

        /// <summary>
        /// 获取登录验证码Key
        /// </summary>
        /// <param name="phone"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        string GetLoginCodeKey(string phone, string code);
        /// <summary>
        /// 设置登录验证码
        /// </summary>
        /// <param name="phone"></param>
        /// <param name="code"></param>
        void SetLoginCodeKey(string phone, string code);
        /// <summary>
        /// 验证登录验证码是否有效
        /// </summary>
        /// <param name="phone"></param>
        /// <param name="code"></param>
        /// <returns></returns>
        bool CheckLoginCodeIsEffective(string phone, string code);
    }
}
